<?php
require_once('/lib/dbclass.php');
$db = new MySQL();


if (! $db->Query("SELECT * FROM berita INNER JOIN kategori
ON berita.id_kategori=kategori.id_kategori order by id_berita desc limit 4;")) $db->Kill(); 
	
?>

<style>
table a{
	font:Verdana, Geneva, sans-serif;
	color:#4fc0aa;
	font-size:14px;
	font-weight:bold;
	}
	
table p{
	font:Verdana, Geneva, sans-serif;
	color:#4fc0aa;
	font-size:12px;
	}

.fontjudul{
	font:Verdana, Geneva, sans-serif;
	color:#4fc0aa;
	font-size:14px;
	}
.fontisi{
	font:Verdana, Geneva, sans-serif;
	color:#333;
	font-size:12px;	
	}
.post{
	font:Verdana, Geneva, sans-serif;
	color:#3e91f6;
	
	}
</style>
<?php while($rs = $db->RowArray()):?>
<table width="950" border="0">
  <tr>
    <td height="20" colspan="2"  align="left" valign="top"><a href="index.php?q=11&id=<?php echo $rs['id_berita'] ?>" class="fontjudul"><strong><?php echo $rs['judul']; ?></strong></a></td>
  </tr>
  <tr>
    <td width="157"  align="left" valign="top"><strong><em>Kategori:</em></strong> <?php echo $rs['nama_kategori']; ?></td>
    <td width="633" height="20" valign="top"><?php echo $rs['tanggal']; ?></td>
  </tr>
  <tr>
    <td width="157"  align="center" valign="top"><img src="admin/images/berita/<?php echo $rs ['gambar']; ?>" width="147"  height="107" align="top" style="float: left; padding: 5px"/></td>
    <td height="99" valign="top"><div align="justify" class="fontisi"><?php echo substr ($rs['isi_berita'],0,350);?>...<a href="index.php?q=11&amp;id=<?php echo $rs['id_berita'] ?>">[Read More]</a></div>
    <div align="right"><font size="-1"></font></div></td>
  </tr>
  <tr>
    <td width="157"  align="center" valign="top">&nbsp;</td>
    <td valign="top">&nbsp;</td>
  </tr>
</table>
<?php endwhile;?>

<table width="950" border="0">
  <tr>
    <td width="364" align="left"><a href="index.php?q=13" class="fontjudul">Index Berita</a></td>
    <td width="320" align="right" class="fontjudul"><?php $n=4; ?>
    <a class="fontjudul" href="index.php?q=12&amp;id=<?php echo $n; ?>">Berita Sebelumnya...</a></td>
  </tr>
</table>
